﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Codemi.Common.Helpers
{
    static class ConfigHelper
    {

        public static string GetValueFromConfig(string key, string defaultValue)
        {
            if (System.Configuration.ConfigurationManager.AppSettings[key] != null)
            {
                return System.Configuration.ConfigurationManager.AppSettings[key].ToString();
            }
            return defaultValue;
        }

        public static bool GetValueFromConfig(string key, bool defaultValue)
        {
            if (System.Configuration.ConfigurationManager.AppSettings[key] != null)
            {
                return Boolean.TryParse(System.Configuration.ConfigurationManager.AppSettings[key].ToString(), out defaultValue);
            }
            return defaultValue;
        }


    }
}
